package com.iterator.self;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class ComputerCompany implements Company{

    private List<Sector> sectorList;

    public ComputerCompany() {
        this.sectorList = new ArrayList<>();
        addSector("电脑配件","电脑配件");
        addSector("电脑配件1","电脑配件1");
        addSector("电脑配件2","电脑配件2");
        addSector("电脑配件3","电脑配件3");
    }

    @Override
    public String getName() {
        return "电脑公司";
    }

    @Override
    public void addSector(String name,String desc) {
        this.sectorList.add(new Sector(name, desc));
    }

    @Override
    public Iterator getIterator() {
        return new ComputerCompanyIterator(sectorList);
    }
}
